package com.lier.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import com.lier.common.valid.group.AddGroup;
import com.lier.common.valid.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;
import javax.validation.constraints.*;

/**
 * 品牌
 *
 * @author lier
 * @email 664478853@qq.com
 * @date 2025-06-06 14:14:16
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@Null(message = "新增时id必须为空", groups = {AddGroup.class})
	@NotNull(message = "修改时id不能为空", groups = {UpdateGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名称不能为空", groups = {AddGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(groups = {AddGroup.class}, message = "新增时图片url不能为空")
	@URL(message = "logo地址url不合法", groups = {AddGroup.class, UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	@NotBlank(message = "介绍不能为空", groups = {AddGroup.class})
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(groups = {AddGroup.class}, message = "新增时显示状态不能为空")
	@Range(min = 0, max = 1, message = "显示状态必须为0或1", groups = {AddGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(groups = {AddGroup.class}, message = "新增时检索首字母不能为空")
	@Pattern(regexp = "^[a-zA-Z]$", message = "值必须为一个英文字母", groups = {AddGroup.class, UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(groups = {AddGroup.class}, message = "新增时, 排序值不能为空")
	@Min(value = 0, message = "排序的值必须为大于等于0的整数", groups = {AddGroup.class, UpdateGroup.class})
	private Integer sort;

}
